Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding name of resource that were not restored on applicationrestore.go #1389

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

camartinez04
Copy link

What type of PR is this?

improvement

What this PR does / why we need it:

On pkg/applicationmanager/controllers/applicationrestore.go line 1608 we need to check which resource were not successfully restored.

Does this PR change a user-facing CRD or CLI?:

no

restore.Status.Reason = fmt.Sprintf("Volumes were restored successfully. Some existing resources were not replaced, resource: %s", resource.Name)

Does this change need to be cherry-picked to a release branch?:

no

@cnbu-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@@ -1605,7 +1605,7 @@ func (a *ApplicationRestoreController) restoreResources(
for _, resource := range restore.Status.Resources {
if resource.Status != storkapi.ApplicationRestoreStatusSuccessful {
restore.Status.Status = storkapi.ApplicationRestoreStatusPartialSuccess
restore.Status.Reason = "Volumes were restored successfully. Some existing resources were not replaced"
restore.Status.Reason = fmt.Sprintf("Volumes were restored successfully. Some existing resources were not replaced, resource: %s", resource.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the overall status of the restore. So we are avoiding giving details of the specific resource. We do have resource level status, where the retained status is maintained. If we add the resource name here, it will confusing that only because of this resource alone, it is partial success.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siva-portworx I was thinking on that, it would require to change our Struct, changing the field restore.Status.reason to a slice of Strings, filling that list with the non-restored objects (with a previous check, if all of them failed, just inform that) and non stopping the for loop at the first occurrence as we currently do. All that sounds like lot of effort. I see, probably a message of where the user can find more details would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants